package com.itheima.netty.instance.test;

import java.util.concurrent.PriorityBlockingQueue;

public class ConsumerRunnable implements Runnable {

	private PriorityBlockingQueue<Human> queue;

	public ConsumerRunnable(PriorityBlockingQueue<Human> queue) {
		this.queue = queue;
	}

	public void run() {

		while (true) {
			Human take = null;
			/*Human human = queue.peek();
			if(human.getManey() > 5000){
				System.out.println(human.getName()+":"+human.getManey());
			}*/			
			take = queue.poll();
			
			if (take == null) {
				break;
			}
			System.out.println(take + " 办理业务.");
		}
	}
}
